home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / enemy / DroidB.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  19.9 KB  |  664 lines

  1. class classes.enemy.DroidB
  2. {
  3.    var x;
  4.    var y;
  5.    var moveScript;
  6.    var matrixCoords;
  7.    var id;
  8.    var form;
  9.    var clip;
  10.    var advanceMax;
  11.    var advanceMax2;
  12.    var matrixVar;
  13.    var colorR;
  14.    var trans;
  15.    var colorTrans;
  16.    var dir;
  17.    var f2;
  18.    var axis;
  19.    var xDest;
  20.    var yDest;
  21.    var oldDir;
  22.    var xMov = 0;
  23.    var yMov = 0;
  24.    var xmt = 0;
  25.    var ymt = 0;
  26.    var xMovT = 0;
  27.    var yMovT = 0;
  28.    var speedOrig = 8;
  29.    var speed = 8;
  30.    var xDestMet = false;
  31.    var yDestMet = false;
  32.    var c = 0;
  33.    var feelerInfo = [[-400,0,400,40],[0,0,400,40],[0,-400,40,400],[0,0,40,400]];
  34.    var dirArray = ["L","R","U","D"];
  35.    var life = 3;
  36.    var nc = 0;
  37.    var xA = 0;
  38.    var yA = 0;
  39.    var nudging = false;
  40.    var power = 20;
  41.    var fc = 0;
  42.    var firing = false;
  43.    var Name = "droidB";
  44.    function DroidB(px, py, pmoveScript, pmatrixCoords, pform, pid)
  45.    {
  46.       this.x = px;
  47.       this.y = py;
  48.       this.moveScript = pmoveScript.slice();
  49.       this.matrixCoords = pmatrixCoords.slice();
  50.       this.id = pid;
  51.       this.form = pform.slice();
  52.       _root.d = _root.d + 1;
  53.       this.clip = _root.attachMovie("droidB","droidB" + this.id + "Clip",_root.d + 50000);
  54.       this.clip._x = this.x;
  55.       this.clip._y = this.y;
  56.       this.speed *= _root.dif.speed;
  57.       this.speedOrig = this.speed;
  58.       this.life *= _root.dif.life;
  59.       this.advanceMax = 60 / (this.speed / 2);
  60.       this.advanceMax2 = 50 / (this.speed / 2);
  61.       if(this.matrixCoords[0] == "free")
  62.       {
  63.          this.matrixVar = 0;
  64.       }
  65.       else
  66.       {
  67.          this.matrixVar = 1;
  68.       }
  69.       this.speedVar();
  70.       this.colorR = _root.randRange(-30,30);
  71.       this.trans = new flash.geom.Transform(this.clip);
  72.       this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,this.colorR,this.colorR,this.colorR,0);
  73.       this.trans.colorTransform = this.colorTrans;
  74.       this.parseMoveScript();
  75.       _root.stats.created = _root.stats.created + 1;
  76.    }
  77.    function broBehind()
  78.    {
  79.       this.matrixVar = 0;
  80.       this.yMovT = 0;
  81.       if(random(3) == 1)
  82.       {
  83.          var _loc3_ = _root.randRange2(1.2,1.4);
  84.          this.xMovT = this.dir != "L" ? _loc3_ * this.speed : -1 * _loc3_ * this.speed;
  85.          this.getDirString();
  86.          this.clip.body.gotoAndPlay("attack");
  87.          this.clip.body.face.gotoAndPlay("attack");
  88.          this.clip.body.flame.gotoAndPlay("start");
  89.          this.f2 = "attacking";
  90.       }
  91.       else
  92.       {
  93.          this[this.axis + "MovT"] = 0;
  94.          this.axis = random(2) <= 0 ? "x" : "y";
  95.          _loc3_ = _root.randRange2(0.9,1.1);
  96.          this[this.axis + "MovT"] = random(2) <= 0 ? -1 * _loc3_ * this.speed : _loc3_ * this.speed;
  97.          this.getDirString();
  98.          this.clip.body.flame.gotoAndPlay("start");
  99.          this.f2 = "wander";
  100.       }
  101.    }
  102.    function bombed(num)
  103.    {
  104.       this.f2 = "death";
  105.    }
  106.    function nudge(pxA, pyA, pscale)
  107.    {
  108.       this.nc = 0;
  109.       this.nudging = true;
  110.       var _loc2_ = pscale / 100;
  111.       this.xA = pxA * _loc2_;
  112.       this.yA = pyA * _loc2_;
  113.    }
  114.    function speedVar()
  115.    {
  116.       if(random(3) == 1)
  117.       {
  118.          this.speed *= _root.randRange2(0.9999,1.0001);
  119.       }
  120.    }
  121.    function parseMoveScript()
  122.    {
  123.       this.dir = this.moveScript[0];
  124.       if(this.dir == "break")
  125.       {
  126.          delete this.moveScript;
  127.          this[this.axis + "MovT"] = 0;
  128.          if(this.matrixCoords[0] == "free")
  129.          {
  130.             this.f2 = "wander";
  131.             this.axis = random(10) <= 4 ? "y" : "x";
  132.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  133.             this.speedVar();
  134.             this.getDirString();
  135.          }
  136.          else
  137.          {
  138.             this.xDest = _root.advanceDir != "L" ? this.matrixCoords[0] * 60 : this.matrixCoords[0] * 60 + 320;
  139.             this.yDest = this.matrixCoords[1] * 50 + 10;
  140.             this.axis = Math.abs(this.xDest - this.x) <= Math.abs(this.yDest - this.y) ? "y" : "x";
  141.             this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  142.             this.getDirString();
  143.             this.speedVar();
  144.             this.f2 = "gotoMatrix";
  145.          }
  146.       }
  147.       else
  148.       {
  149.          this[this.axis + "MovT"] = 0;
  150.          this.f2 = "gotoXYDest";
  151.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  152.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  153.          this.speedVar();
  154.          if(this.dir == "L" || this.dir == "U")
  155.          {
  156.             this[this.axis + "Dest"] = this[this.axis] - this.moveScript[1];
  157.          }
  158.          else
  159.          {
  160.             this[this.axis + "Dest"] = this[this.axis] + this.moveScript[1];
  161.          }
  162.          this.moveScript.splice(0,2);
  163.       }
  164.    }
  165.    function gotoXYDest()
  166.    {
  167.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  168.       {
  169.          if(this.axis == "x")
  170.          {
  171.             this.x = this.xDest;
  172.          }
  173.          else
  174.          {
  175.             this.y = this.yDest;
  176.          }
  177.          this.parseMoveScript();
  178.       }
  179.    }
  180.    function gotoMatrix()
  181.    {
  182.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  183.       {
  184.          if(this.axis == "x")
  185.          {
  186.             this.x = this.xDest;
  187.          }
  188.          else
  189.          {
  190.             this.y = this.yDest;
  191.          }
  192.          this[this.axis + "MovT"] = 0;
  193.          this.axis = this.axis != "x" ? "x" : "y";
  194.          this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  195.          this.getDirString();
  196.          this.speed = this.speedOrig;
  197.       }
  198.       if(Math.abs(this.x - this.xDest) < this.speed + 1 && Math.abs(this.y - this.yDest) < this.speed + 1)
  199.       {
  200.          this.x = this.clip._x = this.xDest;
  201.          this.y = this.clip._y = this.yDest;
  202.          this.xMovT = this.xMov = 0;
  203.          this.yMovT = this.yMov = 0;
  204.          this.matrixVar = 2;
  205.          this.dir = _root.advanceDir;
  206.          this.clip.body.flame.gotoAndPlay("still");
  207.          _root.matrixNum = _root.matrixNum + 1;
  208.          if(_root.matrixNum >= _root.matrixSize)
  209.          {
  210.             _root.matrixComplete = true;
  211.          }
  212.          _root["formB" + this.form[0]] = "matrixed";
  213.          this.f2 = "wait";
  214.       }
  215.    }
  216.    function getDirString()
  217.    {
  218.       if(this.xMovT < -1)
  219.       {
  220.          this.dir = "L";
  221.       }
  222.       else if(this.xMovT > 1)
  223.       {
  224.          this.dir = "R";
  225.       }
  226.       else if(this.yMovT > 1)
  227.       {
  228.          this.dir = "D";
  229.       }
  230.       else if(this.yMovT < -1)
  231.       {
  232.          this.dir = "U";
  233.       }
  234.    }
  235.    function evade()
  236.    {
  237.       if(this.matrixVar == 2)
  238.       {
  239.          this.matrixVar = 0;
  240.          this[this.axis + "MovT"] = 0;
  241.          this.xMovT = _root.advanceDir != "L" ? 1.3 * this.speed : -1.3 * this.speed;
  242.          this.getDirString();
  243.          this.clip.body.gotoAndPlay("attack");
  244.          this.clip.body.face.gotoAndPlay("attack");
  245.          this.clip.body.flame.gotoAndPlay("start");
  246.          this.f2 = "attacking";
  247.       }
  248.    }
  249.    function wait()
  250.    {
  251.       if(random(1000) >= 998 + _root.dif.wait && _root.matrixComplete)
  252.       {
  253.          this.dir = this.findDir();
  254.          if(this.dir == _root.advanceDir)
  255.          {
  256.             this.xMovT = _root.advanceDir != "L" ? 1.3 * this.speed : -1.3 * this.speed;
  257.             this.getDirString();
  258.             this.clip.body.gotoAndPlay("attack");
  259.             this.clip.body.face.gotoAndPlay("attack");
  260.             this.clip.body.flame.gotoAndPlay("start");
  261.             this.f2 = "attacking";
  262.             this.matrixVar = 0;
  263.          }
  264.          else if(this.dir == "U" || this.dir == "D")
  265.          {
  266.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  267.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  268.             this.matrixVar = 0;
  269.             this.c = 0;
  270.             this.f2 = "leavingMatrix";
  271.             this.clip.body.flame.gotoAndPlay("start");
  272.          }
  273.          else
  274.          {
  275.             this.dir = _root.advanceDir;
  276.          }
  277.       }
  278.    }
  279.    function leavingMatrix()
  280.    {
  281.       this.c = this.c + 1;
  282.       if(this.c > this.advanceMax2)
  283.       {
  284.          this.c = 0;
  285.          this.dir = this.findDir();
  286.          if(this.dir == _root.advanceDir)
  287.          {
  288.             this.yMovT = 0;
  289.             this.xMovT = _root.advanceDir != "L" ? 1.3 * this.speed : -1.3 * this.speed;
  290.             this.getDirString();
  291.             this.clip.body.gotoAndPlay("attack");
  292.             this.clip.body.face.gotoAndPlay("attack");
  293.             this.f2 = "attacking";
  294.          }
  295.       }
  296.    }
  297.    function findDir()
  298.    {
  299.       _root.d = _root.d + 1;
  300.       _root.attachMovie("feeler","feelerClip",_root.d);
  301.       var _loc7_ = [];
  302.       var _loc9_ = 0;
  303.       var _loc11_ = this.dirArray.length;
  304.       while(_loc9_ < _loc11_)
  305.       {
  306.          _root.feelerClip._x = this.x + this.feelerInfo[_loc9_][0];
  307.          _root.feelerClip._y = this.y + this.feelerInfo[_loc9_][1];
  308.          _root.feelerClip._width = this.feelerInfo[_loc9_][2];
  309.          _root.feelerClip._height = this.feelerInfo[_loc9_][3];
  310.          var _loc3_ = 0;
  311.          var _loc8_ = _root.chars.length;
  312.          var _loc6_ = false;
  313.          while(_loc3_ < _loc8_)
  314.          {
  315.             var _loc5_ = _root.chars[_loc3_] + "Clip";
  316.             if(_root.feelerClip.hitTest(_root[_loc5_]))
  317.             {
  318.                var _loc4_ = _root.chars[_loc3_];
  319.                if(_root[_loc4_].matrixVar == 2 && _loc4_ != this.Name + this.id)
  320.                {
  321.                   _loc6_ = true;
  322.                   break;
  323.                }
  324.             }
  325.             _loc3_ = _loc3_ + 1;
  326.          }
  327.          if(!_loc6_)
  328.          {
  329.             var _loc10_ = _root.advanceDir != "L" ? "L" : "R";
  330.             if(this.dirArray[_loc9_] != _loc10_)
  331.             {
  332.                _loc7_.push(this.dirArray[_loc9_]);
  333.             }
  334.          }
  335.          _loc9_ = _loc9_ + 1;
  336.       }
  337.       _loc9_ = 0;
  338.       _loc11_ = _loc7_.length;
  339.       if(_loc9_ < _loc11_)
  340.       {
  341.          if(_loc7_[_loc9_] == _root.advanceDir)
  342.          {
  343.             return _root.advanceDir;
  344.          }
  345.          return _loc7_[random(_loc7_.length)];
  346.       }
  347.    }
  348.    function attacking()
  349.    {
  350.       this.xMovT *= 1.02;
  351.       this.yMovT *= 1.02;
  352.    }
  353.    function death()
  354.    {
  355.       _root.stats.destroyed = _root.stats.destroyed + 1;
  356.       _root.stats.score += 500;
  357.       if(this.matrixVar == 1)
  358.       {
  359.          _root.matrixNum = _root.matrixNum + 1;
  360.          if(_root.matrixNum >= _root.matrixSize)
  361.          {
  362.             _root.matrixComplete = true;
  363.          }
  364.       }
  365.       _root.powerUp(this.x,this.y,95);
  366.       var _loc3_ = 0;
  367.       var _loc4_ = _root["form" + this.form[0]].length;
  368.       while(_loc3_ < _loc4_)
  369.       {
  370.          if(_root["form" + this.form[0]][_loc3_] == "droidB" + this.id)
  371.          {
  372.             _root["form" + this.form[0]].splice(_loc3_,1);
  373.             if(_root["form" + this.form[0]].length == 0)
  374.             {
  375.                delete _root["form" + this.form[0]];
  376.                if(_root["formB" + this.form[0]] == "matrixed")
  377.                {
  378.                   _root.createPowerUp([this.x,this.y,"coin1"]);
  379.                   _root.stats.score += 500;
  380.                }
  381.                else
  382.                {
  383.                   _loc3_ = 0;
  384.                   _loc4_ = random(2) + 2;
  385.                   while(_loc3_ < _loc4_)
  386.                   {
  387.                      _root.createPowerUp([this.x,this.y,"coin1"]);
  388.                      _loc3_ = _loc3_ + 1;
  389.                   }
  390.                   _root.stats.score += 1000;
  391.                }
  392.                delete _root["formB" + this.form[0]];
  393.             }
  394.             break;
  395.          }
  396.          _loc3_ = _loc3_ + 1;
  397.       }
  398.       _root.createExploA([this.x + this.clip._width / 2,this.y + this.clip._height / 2,_root.randRange(80,130),_root.randRange(75,100),"Purple"]);
  399.       _loc3_ = 0;
  400.       _loc4_ = random(3);
  401.       var _loc5_ = ["grey","red"];
  402.       while(_loc3_ < _loc4_)
  403.       {
  404.          _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"droidB","Purple"]);
  405.          _loc3_ = _loc3_ + 1;
  406.       }
  407.       _root.createEnemySoul([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"blue"]);
  408.       _root.audio.playLevel4("droidX" + (random(3) + 1),_root.randRange(15,33));
  409.       _root.removeChar("droidB" + this.id);
  410.       this.f2 = "";
  411.    }
  412.    function advance()
  413.    {
  414.       this.dir = _root.advanceDir;
  415.       this.clip.body.flame.gotoAndPlay("advance");
  416.       this.xMovT = _root.advanceDir != "L" ? 1 * (this.speed / 2) : -1 * (this.speed / 2);
  417.       this.f2 = "advancing";
  418.    }
  419.    function advancing()
  420.    {
  421.       this.c = this.c + 1;
  422.       if(this.c > this.advanceMax)
  423.       {
  424.          this.xMovT = 0;
  425.          this.c = 0;
  426.          this.f2 = "wait";
  427.          _root.d = _root.d + 1;
  428.          _root.attachMovie("sight","sightClip",_root.d);
  429.          _root.sightClip.gotoAndStop("hindSight");
  430.          _root.sightClip._x = this.x;
  431.          _root.sightClip._y = this.y;
  432.          if(_root.advanceDir == "L")
  433.          {
  434.             _root.sightClip._rotation = 180;
  435.          }
  436.          if(_root.sightClip.hitTest(_root[_root.char].x,_root[_root.char].y,true))
  437.          {
  438.             _root.broBehind();
  439.          }
  440.          removeMovieClip(_root.sightClip);
  441.       }
  442.    }
  443.    function wander()
  444.    {
  445.       if(random(100) > 98 + _root.dif.wander)
  446.       {
  447.          this[this.axis + "MovT"] = 0;
  448.          this.axis = this.axis != "x" ? "x" : "y";
  449.          this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  450.          this.getDirString();
  451.       }
  452.    }
  453.    function death2()
  454.    {
  455.       _root.removeChar("droidB" + this.id);
  456.       this.f2 = "";
  457.    }
  458.    function main()
  459.    {
  460.       this[this.f2]();
  461.       if(this.oldDir != this.dir)
  462.       {
  463.          this.clip.gotoAndStop("fly" + this.dir);
  464.       }
  465.       this.oldDir = this.dir;
  466.       if(random(250) > 247)
  467.       {
  468.          _root.d = _root.d + 1;
  469.          _root.attachMovie("feeler","feelerClip",_root.d);
  470.          if(this.dir == "L")
  471.          {
  472.             var _loc9_ = [-310,0,300,50];
  473.          }
  474.          else if(this.dir == "R")
  475.          {
  476.             _loc9_ = [50,0,300,50];
  477.          }
  478.          else if(this.dir == "U")
  479.          {
  480.             _loc9_ = [0,-310,50,300];
  481.          }
  482.          else
  483.          {
  484.             _loc9_ = [0,50,300,50];
  485.          }
  486.          _root.feelerClip._x = this.x + _loc9_[0];
  487.          _root.feelerClip._y = this.y + _loc9_[1];
  488.          _root.feelerClip._width = _loc9_[2];
  489.          _root.feelerClip._height = _loc9_[3];
  490.          var _loc4_ = 0;
  491.          var _loc8_ = _root.chars.length;
  492.          var _loc7_ = false;
  493.          while(_loc4_ < _loc8_)
  494.          {
  495.             var _loc6_ = _root.chars[_loc4_] + "Clip";
  496.             if(_root.feelerClip.hitTest(_root[_loc6_]))
  497.             {
  498.                var _loc3_ = _root.chars[_loc4_];
  499.                if(_root[_loc3_].Name.substr(0,3) != "bro")
  500.                {
  501.                   _loc7_ = true;
  502.                }
  503.             }
  504.             _loc4_ = _loc4_ + 1;
  505.          }
  506.          removeMovieClip(_root.feelerClip);
  507.          if(!_loc7_)
  508.          {
  509.             _root.d = _root.d + 1;
  510.             _root.attachMovie("sight","sightClip",_root.d);
  511.             _root.sightClip._x = this.x;
  512.             _root.sightClip._y = this.y;
  513.             if(this.dir == "U")
  514.             {
  515.                _root.sightClip._rotation = 90;
  516.             }
  517.             else if(this.dir == "R")
  518.             {
  519.                _root.sightClip._rotation = 180;
  520.             }
  521.             else if(this.dir == "D")
  522.             {
  523.                _root.sightClip._rotation = -90;
  524.             }
  525.             if(_root.sightClip.hitTest(_root[_root.char].x,_root[_root.char].y,true))
  526.             {
  527.                this.fc = 0;
  528.                this.firing = true;
  529.                this.clip.body.face.blast.gotoAndPlay("go");
  530.                this.clip.body.blast.gotoAndPlay("go");
  531.                _root.audio.playLevel3("droidBFire2",_root.randRange(8,18));
  532.             }
  533.             removeMovieClip(_root.sightClip);
  534.          }
  535.       }
  536.       if(this.firing)
  537.       {
  538.          this.fc = this.fc + 1;
  539.          if(this.fc == 15)
  540.          {
  541.             if(this.dir == "L")
  542.             {
  543.                var _loc10_ = this.x + 0;
  544.                var _loc12_ = this.y + 0;
  545.             }
  546.             else if(this.dir == "R")
  547.             {
  548.                _loc10_ = this.x + 3;
  549.                _loc12_ = this.y + 0;
  550.             }
  551.             else if(this.dir == "U")
  552.             {
  553.                _loc10_ = this.x + 0;
  554.                _loc12_ = this.y + 0;
  555.             }
  556.             else
  557.             {
  558.                _loc10_ = this.x + 0;
  559.                _loc12_ = this.y + 3;
  560.             }
  561.             _root.enemyShotID = _root.enemyShotID + 1;
  562.             _root["droidBFire" + _root.enemyShotID] = new classes.shots.DroidBFire(_loc10_,_loc12_,this.dir,_root.enemyShotID);
  563.             _root.addEnemyShot("droidBFire" + _root.enemyShotID);
  564.             this.firing = false;
  565.          }
  566.       }
  567.       if(this.nudging)
  568.       {
  569.          this.xA *= 0.5;
  570.          this.yA *= 0.5;
  571.          this.nc = this.nc + 1;
  572.          var _loc11_ = 255 - this.nc * 17;
  573.          this.colorTrans.redOffset = _loc11_;
  574.          this.trans.colorTransform = this.colorTrans;
  575.          if(this.nc == 15)
  576.          {
  577.             this.xA = this.yA = 0;
  578.             this.nudging = false;
  579.             this.colorTrans.redOffset = this.colorR;
  580.             this.trans.colorTransform = this.colorTrans;
  581.          }
  582.       }
  583.       _loc4_ = 0;
  584.       _loc8_ = _root.broShots.length;
  585.       while(_loc4_ < _loc8_)
  586.       {
  587.          _loc6_ = _root.broShots[_loc4_] + "Clip";
  588.          if(this.clip.hitTest(_root[_loc6_]))
  589.          {
  590.             _loc3_ = _root.broShots[_loc4_];
  591.             var _loc5_ = this.life;
  592.             this.life -= _root[_loc3_].power;
  593.             if(this.life < 1)
  594.             {
  595.                this.f2 = "death";
  596.             }
  597.             else
  598.             {
  599.                _root.audio.playLevel4("droidHit" + (random(2) + 1),_root.randRange(3,8));
  600.                this.nudge(_root[_loc3_].xMov,_root[_loc3_].yMov,20);
  601.             }
  602.             _root[_root.char].fc = _root[_root.char].fireFreq - _root.rapidVar;
  603.             _root[_loc3_].exploX = this.x + this.clip._width / 2;
  604.             _root[_loc3_].exploY = this.y + this.clip._height / 2;
  605.             _root[_loc3_].hit(_loc5_);
  606.             break;
  607.          }
  608.          _loc4_ = _loc4_ + 1;
  609.       }
  610.       if(this.clip.hitTest(_root[_root.char + "Clip"]))
  611.       {
  612.          _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
  613.          this.f2 = "death";
  614.       }
  615.       if(this.x > 1050 || this.x < -50 || this.y < -50 || this.y > 650)
  616.       {
  617.          delete _root["form" + this.form[0]];
  618.          delete _root["formB" + this.form[0]];
  619.          this.f2 = "death2";
  620.       }
  621.       if(this.xMovT < this.xMov)
  622.       {
  623.          this.xMov -= 1;
  624.       }
  625.       else if(this.xMovT > this.xMov)
  626.       {
  627.          this.xMov += 1;
  628.       }
  629.       else
  630.       {
  631.          this.xMov = this.xMovT;
  632.       }
  633.       if(this.yMovT < this.yMov)
  634.       {
  635.          this.yMov -= 1;
  636.       }
  637.       else if(this.yMovT > this.yMov)
  638.       {
  639.          this.yMov += 1;
  640.       }
  641.       else
  642.       {
  643.          this.yMov = this.yMovT;
  644.       }
  645.       this.xmt = this.xMov;
  646.       this.ymt = this.yMov;
  647.       if(random(10) == 1)
  648.       {
  649.          if(this.axis == "y")
  650.          {
  651.             this.xmt += _root.randRange2(-1,1);
  652.          }
  653.          else
  654.          {
  655.             this.ymt += _root.randRange2(-1,1);
  656.          }
  657.       }
  658.       this.x += this.xmt + this.xA;
  659.       this.y += this.ymt + this.yA;
  660.       this.clip._x = this.x;
  661.       this.clip._y = this.y;
  662.    }
  663. }
  664.